package utils

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
)

func Md5(str, salt string) string {
	h := md5.New()
	h.Write([]byte(fmt.Sprintf("%s_%s", str, salt)))
	cipherStr := h.Sum(nil)
	return hex.EncodeToString(cipherStr)
}

func Md51(str []byte) string {
	h := md5.New()
	h.Write(str)
	cipherStr := h.Sum(nil)
	return hex.EncodeToString(cipherStr)
}
